package com.lnb.system.controller;

import com.lnb.common.request.PageRequest;
import com.lnb.common.result.PageResult;
import com.lnb.common.result.Result;
import com.lnb.system.manager.UserManager;
import com.lnb.system.vo.UserVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Tag(name = "用户管理")
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserManager userManager;

    @Operation(summary = "用户列表")
    @PostMapping("/pageList")
    public Result<PageResult<UserVO>> pageList(@RequestBody PageRequest<Object> pageRequest){
        PageResult<UserVO> pageResult = userManager.pageList(pageRequest);
        return Result.success(pageResult);
    }
}
